package com.iraeta.service.basedata.impl;

import com.iraeta.dao.basedata.OrdermxDao;
import com.iraeta.entity.Ordermx;
import com.iraeta.entity.vo.OrdermxVo;
import com.iraeta.service.basedata.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {
    @Autowired
    OrdermxDao ordermxDao;

    @Override
    public int addOrdermx(Ordermx ordermx) {
        return ordermxDao.insert(ordermx);
    }

    @Override
    public int updateOrdermx(Ordermx ordermx) {
        return ordermxDao.updateByPrimaryKey(ordermx);
    }

    @Override
    public Ordermx getOrdermx(int id) {
        return ordermxDao.selectByPrimaryKey(id);
    }

    @Override
    public int deleteOrdermx(int id) {
        return ordermxDao.deleteByPrimaryKey(id);
    }

    @Override
    public List<OrdermxVo> listOrdermxVo(String kehuName, String orderNumber) {
        return ordermxDao.listOrdermxVo(kehuName, orderNumber);
    }

    @Override
    public List<OrdermxVo> listUserOrdermxVo(Integer kehuId, String orderNumber) {
        return ordermxDao.listUserOrdermxVo(kehuId, orderNumber);
    }
}
